package cn.bon.schedule.service.impl;

import cn.bon.schedule.api.pojo.po.ScheduDetail;
import cn.bon.schedule.mapper.ScheduDetailMapper;
import cn.bon.schedule.service.ScheduDetailService;
import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 排班详情 服务实现类
 * </p>
 *
 * @author LuoChao
 * @since 2023-12-14
 */
@Service
public class ScheduDetailServiceImpl extends ServiceImpl<ScheduDetailMapper, ScheduDetail> implements ScheduDetailService {

    /**
     * 添加排班每日详情
     * @param scheduDetails 排班详情DTO
     * @param comId 所排班的人员或者班组 id
     */
    @Override
    public void add(ScheduDetail[] scheduDetails, Long comId) {
        //3.添加实时排班详情
        for (ScheduDetail scheduDetail : scheduDetails) {
            scheduDetail.setComId(comId);
            this.save(scheduDetail);
        }
    }
}
